package com.example.mykotlin.model.entity

import com.example.mykotlin.base.valid.Insert
import com.mybatisflex.annotation.Id
import io.swagger.v3.oas.annotations.media.Schema
import jakarta.validation.constraints.NotBlank
import jakarta.validation.constraints.NotNull
import jakarta.validation.constraints.Size

@Schema(name = "UserPermission", title = "用户权限关联表")
open class UserPermission(
    @Id
    @field:NotNull(message = "不能为空", groups = [Insert::class])
    var userId: Long? = null,

    @Id
    @field:Size(max = 128, message = "长度不能超过128")
    @field:NotBlank(message = "不能为空", groups = [Insert::class])
    var permissionId: String? = null,

    @Schema(title = "0: 赋予权限, 1: 排除权限")
    @field:NotNull(message = "不能为空", groups = [Insert::class])
    var isExcluded: Boolean? = null
)